import { BrowserModule } from '@angular/platform-browser';
import { TransferHttpCacheModule } from '@nguniversal/common';
import { NgModule } from '@angular/core';
import { APP_BASE_HREF } from '@angular/common';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { NgZorroAntdModule } from 'imeepos-antd';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { ApolloModule } from 'apollo-angular';
import { HttpLinkModule } from 'apollo-angular-link-http';

import { RoutesModule } from './routes/routes.module';
import { AppComponent } from './app.component';
import { LayoutModule } from './layout/layout.module';
import { SharedModule } from './share/share.module';
import { DefaultInterceptor } from './core/net/default-interceptor';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule.withServerTransition({ appId: 'meepo-app' }),
    TransferHttpCacheModule,
    HttpClientModule,
    NgZorroAntdModule.forRoot(),
    BrowserAnimationsModule,
    SharedModule,
    LayoutModule,
    RoutesModule,
    ApolloModule,
    HttpLinkModule
  ],
  providers: [{
    provide: APP_BASE_HREF,
    useValue: "/"
  }, {
    provide: HTTP_INTERCEPTORS,
    useClass: DefaultInterceptor,
    multi: true
  }],
  bootstrap: [AppComponent]
})
export class AppModule { }
